package com.ycg.vue.Enum;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description minio存储桶名称枚举类
 * @Author jink
 * @Date 2024/05/10 16:29
 */
@Getter
@AllArgsConstructor
public enum MinIOPathEnum {
    /**
     * 桶的名称
     * 文件：file
     * 图片：image
     * 视频：video
     * 音频：audio
     * 文档：document
     * 压缩文件：compress
     */
    FILE("FILE", "file","/file/"),
    HEAD_IMG("HEAD_IMG", "img","/head-img/"),//头像
    VIDEO("VIDEO",  "video","/video/"),
    AUDIO("AUDIO",  "audio","/audio/"),
    DOCUMENT("DOCUMENT", "document","/document/"),
    COMPRESS("COMPRESS", "compress","/compress/"),
    BILL_ICON("BILL", "img","/bill-icon/"),
    PAGE_IMG("PAGE_IMG", "img","/page-img/"), //首页轮播图s
    MATERIAL_LIBRARY("MATERIAL_LIBRARY", "img","/material-library/"); //素材库

    private final String name;
    private final String root;
    private final String path;

    //根据name获取value
    public static String getPathByName(String name) {
        for (MinIOPathEnum bucket : MinIOPathEnum.values()) {
            if (bucket.getName().equals(name)) {
                return bucket.getPath();
            }
        }
        return null;
    }
}
